package day1109;

public class Test4 {
    public static void main(String[] args) {
        StringBuilder builder=new StringBuilder();
        StringBuffer buffer=new StringBuffer();

        long a=System.nanoTime();
        for (int i=0;i<100000;i++){
            builder.append(18);
        }
        long b=System.nanoTime();
        System.out.println("builder:"+(b-a));

        long c=System.nanoTime();
        for (int i=0;i<100000;i++){
            buffer.append(18);
        }
        long d=System.nanoTime();
        System.out.println("buffer:"+(d-c));
    }
}
